import { Login } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import { obj2fd } from "@/utils/index";
import http from "@/api";
// 查询列表
export const getDataByPage = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/admin/adminList/${params?.pageNum}/${params?.pageSize}`, {}, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 新增
export const addData = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/admin/adminAdd`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const editData = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/admin/adminUpdate`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 删除列表
export const deleteData = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/admin/adminDel`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
